using System;
using Domain.Engine.Events;
using SimpleCqrs.Domain;

namespace Domain.Engine.Domain
{
  public class HelloAggregate : AggregateRoot
  {
    public HelloAggregate()
    {
    }

    public HelloAggregate(Guid id, string name)
    {
      Apply(new HelloCreatedEvent
      {
        AggregateRootId = id,
        Name = name
      });
    }

    public void OnHelloCreated(HelloCreatedEvent helloCreatedEvent)
    {
      Id = helloCreatedEvent.AggregateRootId;
    }
  }
}